package org.example.struct.array;

/**
 * @author liyishan
 * @date 2024/4/7 14:54
 * @apiNote
 */

public class LCR173TakeAttendance {
    public int takeAttendance(int[] records) {
        int i = 0, j = records.length - 1;
        while(i <= j) {
            int m = (i + j) / 2;
            if(records[m] == m){
                i = m + 1;
            } else {
                j = m - 1;
            }
        }
        return i;
    }
}
